#include "fWallpaper.h"

#include "CUtils.h"
#include <QPalette>
#include <QBrush>
#include <QPixmap>
#include <QPainter>


fWallpaper::fWallpaper(QWidget *parent) : QWidget(parent)
{
    setWindowFlags(Qt::FramelessWindowHint);
    setWindowState(Qt::WindowMaximized);
    HWND handle= CUtils::GetWorkerW();
    HWND view=(HWND)winId();
    SetParent(view,handle);
    SetWindowPos(view,HWND_TOP,0,0,0,0,WS_EX_LEFT|WS_EX_LTRREADING|WS_EX_RIGHTSCROLLBAR|WS_EX_NOACTIVATE);
}

void fWallpaper::paintEvent(QPaintEvent *e)
{
    QPixmap pix(":/timg.jpg");
    QPainter p(this);
    p.drawPixmap(rect(),pix);
}
